﻿<form method="post">
    @Html.AntiForgeryToken()
    <div style="text-align:center; padding-top:50px;">
        <div>
            将任务状态改变为：
            <select id="status" name="status" class="myselect" validate="empty">
                @Html.Raw(ViewData["statusOptions"])
            </select>
            <input type="button" class="mybutton" value="确&nbsp;定" onclick="saveStatus(this);" />
            <span type="msg"></span>
        </div>
    </div>
</form>
<script type="text/javascript">
    var win = new RoadUI.Window();
    function saveStatus(but)
    {
        var f = document.forms[0];
        if (new RoadUI.Validate().validateForm(f))
        {
            var o = RoadUI.Core.serializeForm($(f));
            $(but).prop("disabled", true);
            $.ajax({
                url: "SaveStatus@(Html.Raw(ViewData["queryString"]))", data: o, type: "post", success: function (text)
                {
                    alert(text);
                    $(but).prop("disabled", false);
                    win.reloadOpener();
                    win.close();
                }
            });
        }
    }
</script>